package com.qy.StudentInfo.service.impl;

import com.qy.StudentInfo.handler.AdminHandler;
import com.qy.StudentInfo.mapper.WangMapper;
import com.qy.StudentInfo.pojo.Grade;
import com.qy.StudentInfo.pojo.Wang;
import com.qy.StudentInfo.service.WangService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: student-info-master
 * @author: QiYue
 * @create: 20220430 18:22
 **/
@Service
public class WangServiceImpl implements WangService {
    private static Logger log = Logger.getLogger(WangServiceImpl.class.getClass());

    @Autowired
    private WangMapper wangMapper;

    /**
     * 根据查询所有的公告
     * @param pageNo
     * @param pageSize
     * @param id
     * @return
     */
    @Override
    public List<Wang> getByTeacherTid(int pageNo, int pageSize, String id) {
        List<Wang> wangList = new ArrayList<>();
        log.info("开始进行查询所有的公告!!!!!!!!!");
        Map<String,Object> data = new HashMap<String,Object>();
        data.put("pageNo",(pageNo-1) * pageSize);
        data.put("pageSize",pageSize);
        data.put("id",id);
        wangList = wangMapper.selectAllAnnoun(data);
//        log.info("公告查询完成!结果为:"+wangList);
        System.out.println("公告查询完成!结果为:"+wangList);
        return wangList;
    }
}
